//
//  SpecialTableViewCell.m
//  MoGuRadio
//
//  Created by dlios on 15/6/8.
//  Copyright (c) 2015年 mogu.com 蘑菇科技. All rights reserved.
//

#import "SpecialTableViewCell.h"

@implementation SpecialTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.titleLabel = [[UILabel alloc] init];
//        self.titleLabel.backgroundColor = [UIColor lightGrayColor];
        self.titleLabel.font = [UIFont boldSystemFontOfSize:15];
        self.titleLabel.numberOfLines = 0;
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        
        self.listenImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.listenImageView];
        [_listenImageView release];
        
        
        self.likeImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.likeImageView];
        [_likeImageView release];
        
        
        self.updateTimeImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.updateTimeImageView];
        [_updateTimeImageView release];
        
        
        self.listenNumLabel = [[UILabel alloc] init];
//        self.listenNumLabel.backgroundColor = [UIColor blueColor];
        self.listenNumLabel.font = [UIFont boldSystemFontOfSize:13];
        [self.contentView addSubview:self.listenNumLabel];
        [_listenNumLabel release];
        
        
        self.likedNumLabel = [[UILabel alloc] init];
//        self.likedNumLabel.backgroundColor = [UIColor yellowColor];
        self.likedNumLabel.font = [UIFont boldSystemFontOfSize:13];
        [self.contentView addSubview:self.likedNumLabel];
        [_likedNumLabel release];
        
        
        self.updateTimeLabel = [[UILabel alloc] init];
//        self.updateTimeLabel.backgroundColor = [UIColor grayColor];
        self.updateTimeLabel.font = [UIFont boldSystemFontOfSize:13];
        [self.contentView addSubview:self.updateTimeLabel];
        [_updateTimeLabel release];
        
        
    }
    
    return self;
    
}


- (void)layoutSubviews
{
    
    [super layoutSubviews];
    CGFloat width = self.contentView.bounds.size.width;
    CGFloat height = self.contentView.bounds.size.height;
    
    self.titleLabel.frame = CGRectMake(width / 15 * kXWidth, height / 8, width, height / 4.5);
    self.listenImageView.frame = CGRectMake(width/ 15 * kXWidth, 60 * kYHeight, width / 18, height / 5);
    self.listenNumLabel.frame = CGRectMake(width / 9 + 8 * kXWidth, 57 * kYHeight, width / 6, height / 4);
   
    self.likeImageView.frame = CGRectMake(width / 4 + 20 * kXWidth, 60 * kYHeight, width / 18, height / 5.5);
    self.likedNumLabel.frame = CGRectMake(width / 3 + 15 * kXWidth, 57 * kYHeight, width / 6, height / 4);
    
    self.updateTimeImageView.frame = CGRectMake(width / 2 + 20 * kXWidth, 60 * kYHeight, width / 15, height / 5);
    self.updateTimeLabel.frame = CGRectMake(width / 2 + 48 * kXWidth, 57 * kYHeight, width / 4, height / 4);
}


- (void)dealloc
{
    [_titleLabel release];
    [_likeImageView release];
    [_listenImageView release];
    [_updateTimeImageView release];
    [_listenNumLabel release];
    [_likedNumLabel release];
    [_updateTimeLabel release];
    [super dealloc];
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
